import request from '../../utils/request.js'
import qs from "qs";
// 便于接口的集中管理，修改，与后端的联调
// 便于和api接口文档一致对应

// 登录api
function Login(data,config){
	return new Promise((resolve,reject)=>{
		request.post("/member/index_login2.php",qs.stringify(data),{showLoading:"急速加载中..."})
		.then(res=>{
			resolve(res);
		})
		.catch(err=>reject(err))
	})
}
// 注册api
function Register(data){
	return new Promise((resolve,reject)=>{
		request.post("/member/reg_new2.php",qs.stringify(data))
		.then(res=>{
			resolve(res);
		})
		.catch(err=>reject(err))
	})
}
//获取信息api
function Getmsg(data){
	return new Promise((resolve,reject)=>{
		request.post("/member/ajax_login.php",qs.stringify(data))
		.then(res=>{
			resolve(res);
		})
		.catch(err=>reject(err))
	})
}
//获取退出api
function Logout(data,config){
	return new Promise((resolve,reject)=>{
		request.post("/member/index_login.php",qs.stringify(data))
		.then(res=>{
			resolve(res);
		})
		.catch(err=>reject(err))
	})
}
function Mock(data){
	return new Promise((resolve,reject)=>{
		request.post("/web/orders/")
		.then(res=>{
			resolve(res);
		})
		.catch(err=>reject(err))
	})
}
export {Login,Register,Getmsg,Logout,Mock};